home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue59 / RichEdit / RTFLoaderU.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-04-26  |  627 b   |  39 lines

  1. unit RTFLoaderU;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, ComCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     RichEdit1: TRichEdit;
  12.     procedure FormCreate(Sender: TObject);
  13.   private
  14.     { Private declarations }
  15.   public
  16.     { Public declarations }
  17.   end;
  18.  
  19. var
  20.   Form1: TForm1;
  21.  
  22. implementation
  23.  
  24. {$R *.DFM}
  25.  
  26. procedure TForm1.FormCreate(Sender: TObject);
  27. var
  28.   RS: TResourceStream;
  29. begin
  30.   RS := TResourceStream.Create(HInstance, 'RTFData', 'RTF');
  31.   try
  32.     RichEdit1.Lines.LoadFromStream(RS)
  33.   finally
  34.     RS.Free
  35.   end
  36. end;
  37.  
  38. end.
  39.